package thread;

import java.util.Scanner;

public class SleepDemo2 {
    public static void main(String[] args) {
        System.out.println("输入倒计时的秒数：");
        Scanner scanner = new Scanner(System.in);
        int i = scanner.nextInt();
        for (int j=i;j>0;j--){
            System.out.println(j);
            try {
                Thread.sleep(1000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
        System.out.println("程序结束");
    }
}
